package learn_bouncycastle.security;

import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class SecSHA1 {
	
	public static void main(String[] args) throws NoSuchAlgorithmException, UnsupportedEncodingException {
		
		String s = "SHA1摘要算法测试";
		
		byte[] digest = MessageDigest.getInstance("SHA1").digest(s.getBytes("utf8"));
		System.out.println(digest.length);
		
		String string = new BigInteger(1, digest).toString(16);
		System.out.println(string);
		
	}
	
}
